<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
   class Test extends Admin_Controller
   {
   	   public  $roleid;
	      function __construct()
	      {
	         parent::__construct();
	         $this->load->model('User_model');
	         $this->roleid= 0;
	      }
	      function index()
	      {
	      	 $res['data']=$this->User_model->post();
	       	 $top_meun = $this->cache->file->get('top_meun_'.$this->roleid);
	         $this->load->view('test',$res);
	      }
	      function add_admin()
	      {
	      	$post=$this->input->post(NULL,TRUE);
	      	if($post['method'])
	      	$url=$post['control'].'/'.$post['method'];
	      	else
	      	$url='';
	      	$res=$this->User_model->add($post['selected'],$post['title'],$post['control'],$post['method'],$url);
	      	if($res)
	      	{
	      		echo 1; //添加成功
	      	}else
	      	{
                echo 2; //添加失败	      		
	      	}
	      }
          public function suc_test()
	      {
	         	$link[0]['text'] = lang('继续修改');
                $link[0]['href'] = site_aurl('sys_set/purview_manage');
                $link[1]['text'] = lang('返回上一层');
                $link[1]['href'] = site_aurl('sys_set/purview_manage');
                $this->common->adminmsg('操作成功','2',$link);
	      }
   }
?>   